import java.awt.peer.SystemTrayPeer;
import java.util.Random;
import java.util.Scanner;

public class Hello_Java {
    public static void main12(String[] args) {
        for (int i = 100; i <= 10000; i++) {
            int sum = 0;
            //先求位数
            int n = 0;
            int tmp = i;
            while(tmp > 0){
                n++;
                tmp /= 10;
            }
            tmp = i;
            while(tmp > 0) {
                sum += Math.pow(tmp % 10, n);
                tmp /= 10;
            }

            if (sum == i){
                System.out.println(sum);
            }

        }
    }

    public static void main11(String[] args) {
        double sum = 0;
        int flag = 1;
        for (int i = 1; i <= 100; i++) {
            double tmp = 1.0 / i * flag;
            sum += tmp;
            flag *= -1;
        }

        System.out.println(sum);
    }

    public static void main10(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt(), b = scanner.nextInt();
        //利用辗转相除法
        int tmp = a % b;
        while(tmp != 0){
            a = b;
            b = tmp;
            tmp = a % b;
        }
        System.out.println("最大公约数为："+ b);
    }

    public static void main9(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int count = 0;
        while(a != 0){
            //每次都把最右边的1去除
            a = (a - 1) & a;
            count++;
        }

        System.out.println(count);
    }

    public static void main8(String[] args) {
        int count = 0;
        for (int i = 1; i < 101; i++) {
            //计算个位
            if (i % 10 == 9) {
                count++;
            }
            //计算10位
            if (i / 10 == 9) {
                count++;
            }
        }
        System.out.println(count);
    }

    public static void main7(String[] args) {
        for (int i = 1000; i < 2001; i++) {
            if (i % 4 == 0 && i % 100 != 0 || i % 400 == 0)
            {
                System.out.print(i + " ");
            }
        }
    }
    
    public static void main6(String[] args) {
        for (int i = 1; i < 101; i++) {
            //利用试除法
            //提高效率，跳过所有偶数
            int j = 0;
            for (j = 2; j < i; j++) {
                if (i % j == 0){
                    break;
                }
            }
            if (j == i){
                System.out.print(i+" ");
            }

        }
    }



    public static void main5(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入：");
        int c = scanner.nextInt();
        int flag = 0;
        //判断素数
        for (int i = 2; i < c; i++) {
            if (c % i == 0){
                System.out.println("不是素数");
                flag = 1;
                break;
            }
        }
        if (flag == 0){
            System.out.println("是素数");
        }

    }
    public static void mai(String[] args) {
        Random random = new Random();
//        Random random2 = new Random(124);
        int randNum = random.nextInt(100);//[0-100)
        System.out.println(randNum);

        //不包含100
        Scanner scanner = new Scanner(System.in);
        while(true){
            System.out.println("请输入你要猜的数字：");
            int num = scanner.nextInt();
            if (num > randNum){
                System.out.println("猜大了");
            }
            else if(num < randNum){
                System.out.println("猜小了");
            }
            else{
                System.out.println("猜对了是"+randNum);
                break;
            }
        }
    }
    public static void main3(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = 5;
//        while (scanner.hasNextInt()){
//            //循环录入
//            int a = scanner.nextInt();
//            System.out.println(a);
//        }
    }

    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.println("输入年龄：");
        int age = scanner.nextInt();
        System.out.println(age);

        scanner.nextLine();

        System.out.println("输入姓名：");
        String name = scanner.nextLine();
        System.out.println(name);

        System.out.println("输入工资：");
        int salary = scanner.nextInt();
        System.out.println(salary);
    }
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入你的姓名：");
        String name = scanner.nextLine();
        System.out.println(name);
    }
}
